package org.csu.goodpartner.persistence;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.csu.goodpartner.VO.OrderVO;
import org.csu.goodpartner.entity.Order;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OrderMapper extends BaseMapper<Order> {
    @Select("select orders.orderid,orders.userid,orders.status,orders.shopid,a.phone," +
            "concat(a.province,a.city,a.area,a.detailAddr) as addr ,orders.orderdate from orders,addr a " +
            "where orders.addrnumber=a.id and orders.shopid=#{shopId} and orders.status=#{status}")
    List<OrderVO> selectByStatus(int shopId, int status);
}